package com.ti.demo.autoconfigure.log;

import org.zalando.logbook.Correlation;
import org.zalando.logbook.HttpRequest;
import org.zalando.logbook.HttpResponse;
import org.zalando.logbook.StructuredHttpLogFormatter;

import java.io.IOException;
import java.util.Map;

/**
 * @description: com.guosen.llm.logbook
 * @Author Triagen
 * @Date 2025/4/14 17:12
 */
public interface ReqRspHttpLogFormatter extends StructuredHttpLogFormatter {
    default String format(final Correlation correlation, final HttpRequest request, final HttpResponse response) throws IOException {
        return format(prepare(correlation, request, response));
    }

    Map<String, Object> prepare(final Correlation correlation, final HttpRequest request, final HttpResponse response) throws IOException;
}
